package cc.admin.common.util;

import org.apache.commons.lang.StringUtils;
import org.checkerframework.checker.units.qual.A;

public enum DySmsEnum {

	LOGIN_TEMPLATE_CODE("SMS_175435174","CC-ADMIN","code"),
	FORGET_PASSWORD_TEMPLATE_CODE("SMS_175435174","CC-ADMIN","code"),
	REGISTER_TEMPLATE_CODE("SMS_175430166","CC-ADMIN","code"),
	AUDIT_NOTICE_TEMPLATE_CODE("SMS_223563255","河北东来","name,days"),
	WORK_STATEMENT_CODE("SMS_224351993","河北东来","staticsName,day,userName"),
	NAVICAT_NOTICE_CODE("SMS_230240014","河北东来","voyage"),
	AUDIT_NOTICE_CODE("SMS_134315741","河北东来","username,time"),
	SHIPYEAR_NOTICE_CODE("SMS_127152797","河北东来","staticsName,sysName,gnName"),
	CONTRACT_NOTICE_CODE("SMS_127162889","河北东来","staticsName,sysName,gnName"),
	SHORT_MESSAGE_NOTICE("SMS_130835295","河北东来","taskname"),
	COMPANY_CAR_WARN("SMS_127152797","河北东来","staticsName,sysName,gnName"),
	COMPANY_QUALIFICATIONS_WARN("SMS_127162889","河北东来","staticsName,sysName,gnName"),
    WRATHER_WARN("SMS_151233448","河北东来","xxly,sj,hy,fq,lq,tq"),
    INVENTORY_WARN("SMS_276425798","河北东来","storeName,inventoryName,currentQuantity,warnThreshold"),
	SMS_YEAR_WARN("SMS_165060575","河北东来","dutyName,year,taskname"),
	SMS_WEEK_WARN("SMS_460655960","河北东来","dutyName,week,taskname"),
	SMS_YEAR_GLFC_WARN("SMS_180351850","河北东来","dutyName,year,taskname"),
	SMS_YEAR_BOAT_WARN("SMS_165070296","河北东来","dutyName,year,boatName,taskname"),
	SMS_QUARTER_WARN("SMS_180356723","河北东来","dutyName,year,quarter,boatName,taskname"),
	SMS_MONTH_WARN("SMS_165070284","河北东来","dutyName,month,boatName,department,taskname"),
	SMS_MONTH_WARN1("SMS_165070302","河北东来","dutyName,month,boatName,taskname"),
	SMS_MONTH_WARN2("SMS_165070429","河北东来","dutyName,month,department,taskname"),
	SMS_YEAR_SRNL_WARN("SMS_180346840","河北东来","dutyName,year,boatName,taskname"),
	SMS_HALFYEAR_WARN("SMS_165116250","河北东来","dutyName,year,halfyear,boatName,taskname"),
	SMS_HALFYEAR_WARN1("SMS_165055114","河北东来","dutyName,year,halfyear,taskname"),
	BAD_WEATHER_WARN("SMS_275495052","河北东来","weather,time_range,address,status,descript");

	/**
	 * 短信模板编码
	 */
	private String templateCode;
	/**
	 * 签名
	 */
	private String signName;
	/**
	 * 短信模板必需的数据名称，多个key以逗号分隔，此处配置作为校验
	 */
	private String keys;

	private DySmsEnum(String templateCode,String signName,String keys) {
		this.templateCode = templateCode;
		this.signName = signName;
		this.keys = keys;
	}

	public String getTemplateCode() {
		return templateCode;
	}

	public void setTemplateCode(String templateCode) {
		this.templateCode = templateCode;
	}

	public String getSignName() {
		return signName;
	}

	public void setSignName(String signName) {
		this.signName = signName;
	}

	public String getKeys() {
		return keys;
	}

	public void setKeys(String keys) {
		this.keys = keys;
	}

	public static DySmsEnum toEnum(String templateCode) {
		if(StringUtils.isEmpty(templateCode)){
			return null;
		}
		for(DySmsEnum item : DySmsEnum.values()) {
			if(item.getTemplateCode().equals(templateCode)) {
				return item;
			}
		}
		return null;
	}
}

